{*include file="template/admin_head.htm"*}

<table id="containtable" cellspacing="0" cellpadding="0" class="{*$cf_controller*}" width="100%">
    <tr>
        <td valign="top" bgcolor="#FFFFFF">


            <div class="wrapper pr_8">
                {*if $cf_action=='withdraw'*}

                <script type="text/javascript">
                   
                    $(function(){			
                        $("#action_form").submit(function(){							
                            if(confirm('确定提交吗?')){
                                return true;
                            }                           
							return false;
							
                        });
						
						
                    })

                </script>

                <div class="content_panel_title">
                    <div class="contentpanelleft"></div>
                    <div class="contentpanelcenter">
                        <span class="contentpanelcenter_font">结账提现</span>
                        <span><a class="edit at" href="{*$cf_self_page*}?dpt={*$cf_dpt*}">结账提现管理</a></span></div>
                    <div class="contentpanelrihgt"></div>
                </div>
                <div class="content_table_center_style">
                    <div class="p8">

                        <form name="action_form" id="action_form" method="post" action="{*$cf_self_page*}">
                            <input name="id" id="id" type="hidden" value="{*$row['sp_id']*}" />
                            <input name="dpt" id="dpt" type="hidden" value="{*$cf_dpt*}" />
                            <input name="act" id="act" type="hidden" value="{*$cf_action*}" />
                            <table width="100%" border="0" cellspacing="0" cellpadding="0" class="tbl tbl_nbr">
                                <tbody>
									<tr>
                                        <td colspan="4" class="stitle">账户信息</td>
                                    </tr>
                                    <tr>
                                      <td align="right">登录名:</td>
                                      <td width="31%" align="left">{*$row.sp_name*}&nbsp;&nbsp;ID:{*$row.sp_id*}</td>
                                      <td width="16%" align="right">父级代理:</td>
                                      <td width="36%" align="left">{*$row['sp_pname']*}</td>
                                    </tr>
									<tr>
                                      <td align="right">注册时间:</td>
                                      <td align="left">{*$row.sp_reg_time*}</td>
                                      <td align="right">更新时间:</td>
                                      <td align="left">{*$row.sp_edit_time*}</td>
                                    </tr>
									<tr>
                                        <td colspan="4" class="stitle">资金及账号信息</td>
                                    </tr>
									<tr>
                                        <td width="17%" align="right">资金:</td>
                                        <td width="31%" align="left">{*$row.sp_money*}</td>
                                        <td align="right">上次结账时间:</td>
                                        <td align="left">{*$row.sp_last_rebate*}</td>
                                    </tr>	
									<tr>
                                        <td width="17%" align="right">销售额:</td>
                                        <td width="31%" align="left">{*$row.sp_sales*}</td>
                                        <td align="right">销售量:</td>
                                        <td align="left">{*$row.sp_sales_order*}</td>
                                    </tr>
									<tr>
										<td align="right">银行账号类型:</td>
										<td align="left">{*$row.sp_bank_type*}</td>
										<td align="right">&nbsp;</td>
										<td align="left">&nbsp;</td>
									</tr>
									<tr>
										<td align="right">开户人(姓名):</td>
										<td align="left">{*$row.sp_bank_name*}</td>
										<td align="right">卡号(账号):</td>
										<td align="left">{*$row.sp_bank_code*}</td>
									</tr>
									<tr>
                                        <td colspan="4" class="stitle">结账</td>
                                    </tr>
                                    <tr>
                                      <td align="right">结账额:</td>
                                      <td colspan="3" align="left"><input type="text" name="money" id="money" value="{*$row.sp_money*}" />&nbsp;&nbsp;&nbsp;&nbsp;<input type="submit" name="submit" id="submit" value="结账提交" class="myinput" /></td>
                                    </tr>
                                    <tr>
                                        <td align="right">&nbsp;</td>
                                        <td align="left">&nbsp;</td>
                                        <td align="right">&nbsp;</td>
                                        <td align="left">&nbsp;</td>
                                    </tr>									
                                   
                                </tbody>
                            </table>
                        
                        </form>
                    </div>
                </div>
                <div class="content_main_bottom">
                    <div class="content_main_bottom_left"></div>
                    <div class="content_main_bottom_right"></div>
                </div>
                
                 <div class="content_panel_title">
                    <div class="contentpanelleft"></div>
                    <div class="contentpanelcenter">
                        <span class="contentpanelcenter_font">结账记录</span>
                    </div>
                    <div class="contentpanelrihgt"></div>
                </div>
                <div class="content_table_center_style">
                    <div class="p8">

                        <table width="100%" class="tbl tbl_nbr">
                            <thead>
                                <tr class="thd">
                                    <td width="9%" align="center">ID</td>
                                    <td width="9%" align="center" class="thr">原有资金</td>
                                    <td width="9%" align="center" class="thr">支出</td>
                                    <td width="9%" align="center" class="thr">支出后</td>
                                    <td width="10%" align="center" class="thr">账号类型</td>
                                    <td width="10%" align="center" class="thr">姓名</td>
                                    <td width="21%" align="center" class="thr">卡号(账号)</td>
                                    <td width="9%" align="center" class="thr">操作人员</td>
                                    <td width="14%" align="center" class="thr">时间</td>
                                </tr>
                            </thead>
                            <tbody>
                                {*foreach $data as $v*}
                                <tr onmouseout="this.style.backgroundColor='#ffF'" onmouseover="this.style.backgroundColor='#ffC'" style=" background-color:#FFFFFF">
                                    <td align="center">{*$v['log_id']*}</td>
                                    <td align="center">{*$v['log_money_first']*}</td>
                                    <td align="center">{*$v['log_money']*}</td>
                                    <td align="center">{*$v['log_money_end']*}</td>
                                    <td align="center">{*$v['log_bank_type']*}</td>
                                    <td align="center">{*$v['log_bank_name']*}</td>
                                    <td align="center">{*$v['log_bank_code']*}</td>
                                    <td align="center">{*$v['log_admin']*}</td>
                                    <td align="center">{*$v['log_create_time']*}</td>
                                </tr>
                                {*/foreach*}

                                <tr class="tft">
                                    <td colspan="9" style="padding:0;">
                                        <table width="100%" border="0">
                                            <tr>
                                                <td width="6%" align="center" style="border:0;padding:0;">&nbsp;</td>
                                            </tr>
                                        </table>                                </td>
                                </tr>
                            </tbody>
                        </table>

                    </div>
                </div>
                <div class="content_main_bottom">
                    <div class="content_main_bottom_left"></div>
                    <div class="content_main_bottom_right"></div>
                </div>

                {*else*}

                <div class="pannel">
                    <div class="pl"></div>
                    <div class="pr"></div>
                    <div class="pc">
                        <form action="" method="get" id="search_form" name="search_form">
                            <input name="dpt" id="dpt" type="hidden" value="{*$cf_dpt*}" />
                            <input name="self" id="self" type="hidden" value="{*$self*}" />
                            <div class="pt">
                                代理商全称:
                                	<input type="text" size="20" id="skey" name="skey" class="tet" value="{*$skey*}" />
								&nbsp;&nbsp;代理商账号:
								<input type="text" size="20" id="skey2" name="skey2" class="tet" value="{*$skey2*}" />
								&nbsp;&nbsp;联系人:<input type="text" size="6" id="skey3" name="skey3" class="tet" value="{*$skey3*}" />
								&nbsp;&nbsp;联系电话: <input type="text" size="12" id="skey4" name="skey4" class="tet" value="{*$skey4*}" />								
                                <br />此日期前未结账:
                                <input name="skey5" class="Wdate" type="text" id="act_start" value="{*$skey5*}" onfocus="WdatePicker({maxDate:'%y-%M-%d',dateFmt:'yyyy-MM-dd',isShowClear:true,readOnly:true});" size="15" maxlength="30" />
                           		&nbsp;&nbsp;<input name="stype" type="checkbox" value="1"  {*if $stype*}checked="checked"{*/if*} /> 
                           		不包括未结账
								&nbsp;&nbsp;
								<input type="image" src="public/images/admin/icon_search_btn.gif" />
							</div>
                        </form>
                    </div>
                </div>
                <div class="content_panel_title">
                    <div class="contentpanelleft"></div>
                    <div class="contentpanelcenter">
                        <span class="contentpanelcenter_font">结账提现管理</span>
                        <span><!--<a class="edit at" href="{*$cf_self_path*}-act_add.htm?dpt={*$cf_dpt*}">新增代理商</a>--></span>&nbsp;
                        </div>
                    <div class="contentpanelrihgt"></div>
                </div>
                <div class="content_table_center_style">
                    <div class="p8">
                        
                        <form name="list_form" id="list_form" method="post" action="{*$cf_self_page*}">
                            <input name="act" type="hidden" value="all" />
                            <input name="dpt" type="hidden" value="{*$cf_dpt*}" />
                            <table width="100%" class="tbl tbl_nbr">
                                <thead>
                                    <tr class="thd">
                                        <td width="7%" align="center" class="thr">ID</td>
                                        <td width="12%" align="center" class="thr">代理商账号</td>
                                        <td width="18%" align="center" class="thr">代理商全称</td>
                                        <td width="10%" align="center" class="thr">联系人</td>
                                        <td width="11%" align="center" class="thr">联系电话</td>
                                        <td width="7%" align="center" class="thr">销售额</td>
                                        <td width="7%" align="center" class="thr">资金</td>
                                        <td width="17%" align="center" class="thr">上次结账时间</td>
                                        <td colspan="2" align="center" class="thr">操作</td>
                                    </tr>
                                </thead>
                                <tbody>
                                    {*foreach name=lead_part item=item from=$data_ary*}                                   
                                    <tr onmouseout="this.style.backgroundColor='#ffF'" onmouseover="this.style.backgroundColor='#ffC'">
                                        <td align="center">{*$item['sp_id']*}</td>
                                        <td align="left"><a href="javascript:void(0)" title="查看詳情" onclick="$(function(){my_iframe('{*$cf_module_path*}detail-act_sp.htm?id={*$item['sp_id']*}','查看詳情-{*$item['sp_title']*}',750,500)})" class="edit" >{*$item['sp_name']*}</a></td>
                                        <td align="center">{*$item['sp_title']*}</td>
                                        <td align="center">{*$item['sp_contact']*}</td>
                                        <td align="center">{*$item['sp_phone']*}</td>
                                        <td align="center">{*$item['sp_sales']*}</td>
                                        <td align="center">{*$item['sp_money']*}</td>
                                        <td align="center">{*if $item['sp_last_rebate']*}{*$item['sp_last_rebate']|date_format:"Y-m-d"*} ({*$item['sp_last_rebate_admin']*}){*/if*}</td>
                                        <td width="4%" align="center"><a href="{*$cf_self_path*}-act_withdraw_id_{*$item['sp_id']*}.htm?dpt={*$cf_dpt*}" class="edit">结账</a></td>
                                        <td width="7%" align="center"><a href="/admin/spmoney.htm?dpt=13&skey2={*$item['sp_id']*}" target="_blank" class="edit">资金记录</a><!--<a href="{*$cf_self_path*}-act_del_id_{*$item['sp_id']*}.htm" class="del" onclick="return confirm('你确定要删除吗?')">删除</a>--></td>
                                    </tr>

                                    {*/foreach*}


                                    <tr class="tft">
                                        <td colspan="10" style="padding:0;">
                                            <table width="100%" border="0">
                                                <tr>
                                                    <td width="2%" align="center" style="border:0;padding:0;"><!--<input type="button" name="checkall" id="checkall" class="myinput" value="全 选" />--></td>
                                                    <td width="11%" align="center" style="border:0;padding:0;">
                                                        <!-- <select name="alltype" id="alltype">
                                                            <option selected="selected" value="">操作選擇</option>
                                                           <option value="allcheck">通過審核</option>
                                                            <option value="alloutcheck">審核不通過</option>
                                                        </select>
                                                        &nbsp;<input type="submit" name="submit_all" id="submit_all" value="批量操作" class="myinput" />--></td>
                                                    <td width="87%" style="border:0;padding:0;" ><div class="turnPage"><p>{*$page*}</p></div></td>
                                                </tr>
                                            </table>                                </td>
                                    </tr>
                                </tbody>
                            </table>
                        </form>
                    </div>
                </div>
                <div class="content_main_bottom">
                    <div class="content_main_bottom_left"></div>
                    <div class="content_main_bottom_right"></div>
                </div>

                {*/if*}
            </div>        </td>
    </tr>
</table>
{*include file="template/admin_foot.htm"*}